/*
 *  WilStartupShutdown.cpp
 *  Wilson
 *
 *  Created by Sebastian Orfino on 11/14/11.
 *  Copyright 2011 lbs3. All rights reserved.
 *
 */



#include "VCPlugInHeaders.h"


#include <boost/shared_ptr.hpp>

// General includes:
#include "CPMUnknown.h"
#include "Utils.h"

// Project includes:
#include "WilID.h"
#include "IStartupShutdownService.h"

#include "csxs_facade.h"
#include "EventosWilson.h"

using namespace eventos;
using namespace wilson;

class WilStartupShutdown : public CPMUnknown<IStartupShutdownService>
{
	
private:
	
	/*boost::shared_ptr<listar_notas_request> eln; ///esto ahora esta en wilson::inicializar()
	boost::shared_ptr<crear_nota_request> ecn;
	boost::shared_ptr<agregar_comentario_request> enc;*/
	
public:

	/**	Constructor
	 @param boss interface ptr from boss object on which this interface is aggregated.
	 */
    WilStartupShutdown(IPMUnknown* boss );
	
	/**	Destructor
	 */
	virtual ~WilStartupShutdown() {}
	
	/**	Called by the core when app is starting up
	 */
    virtual void Startup();
	
	/**	Called by the core when app is shutting down
	 */
    virtual void Shutdown();
};

/* CREATE_PMINTERFACE
 Binds the C++ implementation class onto its ImplementationID 
 making the C++ code callable by the application.
 */
CREATE_PMINTERFACE(WilStartupShutdown, kWilStartupShutdownImpl)

/* Constructor
 */
WilStartupShutdown::WilStartupShutdown(IPMUnknown* boss) :
CPMUnknown<IStartupShutdownService>(boss)
{
}


/* Startup
 */
void WilStartupShutdown::Startup()
{	
		
	/*eln.reset(new listar_notas_request());
    ecn.reset(new crear_nota_request());
	enc.reset(new agregar_comentario_request());
	
	
	wilson::escuchar(eln->ID(),eln.get());
	wilson::escuchar(ecn->ID(),ecn.get());
	wilson::escuchar(enc->ID(),enc.get());*/
	
	//InterfacePtr<IWilEventUtils> eventUtils(Utils<IWilEventUtils>());
	
	//Utils<IWilEventUtils>()->subscribe(eln.ID(),eln);
	//Utils<IWilEventUtils>()->subscribe(ecn.ID(),ecn);
	
}


/* Shutdown
 */
void WilStartupShutdown::Shutdown()
{
	
}
